package by.demchenko.sample.services;

import by.demchenko.sample.datamodel.Person;
import by.demchenko.sample.datamodel.enums.UserType;

import javax.transaction.Transactional;
import java.util.List;

public interface PersonService {

    Person get(Integer id, boolean fetchAll);

    @Transactional
    void save(Person person);

    @Transactional
    void saveOrUpdate(Person person);

    List<Person> getPersonsByType(UserType userType, boolean fetchJoins);

    <C>List<Person> getStudentsByCriteria(C criterion);

    long getCount(UserType teacher);

    void delete(Person person);
}